#include "stdafx.h"
#include <boost/test/auto_unit_test.hpp>
#include "function_mocks_newmocks.hpp"
#include "bmock_control_tools_mock.hpp"
#include "bmock.hpp"

extern  int test_mocks_x3;
struct arg_test3{};

BMOCK_TEST(arg_test3,test_create_mock_void_no_argument)
{
	int x=8;
	BMOCK_CREATE_MOCK("void f_13()");
	BMOCK_EXPECT(f_13());
	BMOCK_REPLAY;
	BOOST_CHECK_NO_THROW(f_13());
	BOOST_CHECK_NO_THROW(f_13(x));
	BMOCK_VERIFY;

}

BMOCK_TEST(arg_test3,test_create_mock_void_with_argument)
{
	int x=9;
	BMOCK_CREATE_MOCK("void f_13(int)");
	BMOCK_EXPECT(f_13(x));
	BMOCK_REPLAY;
	BOOST_CHECK_NO_THROW(f_13());
	BOOST_CHECK_NO_THROW(f_13(9));
	BMOCK_VERIFY;

}


BMOCK_TEST(arg_test3,test_create_mock_not_void_with_argument)
{
	int x=8;
	int y=8;
	int a=9;
	int b=10;

#if defined(_MSC_VER) || defined(__clang__)
	BMOCK_CREATE_MOCK("int f_23(int *)");
#else
	BMOCK_CREATE_MOCK("int f_23(int*)");
#endif

	BMOCK_CREATE_MOCK("void f_13()");
	BMOCK_EXPECT(f_13());
	BMOCK_EXPECT_RETURN(y,f_23(&x));
	BMOCK_REPLAY;
	BOOST_CHECK_NO_THROW(f_13());
	BOOST_CHECK_NO_THROW(b=f_23());
	BOOST_CHECK_NO_THROW(a=f_23(&x));;
	BMOCK_VERIFY;
	BOOST_CHECK_EQUAL(a,y);
	BOOST_CHECK_EQUAL(b,0);

}


